package com.concurrence.primary;

import java.lang.management.ManagementFactory;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;

/**
 * MutilThreadMXBeanDemo..
 *
 * @author Lizhong
 * @date 2019/4/1
 */
public class MutilThreadMXBeanDemo {
    public static void main(String[] args) {
        ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();
        ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(false, false);
        for(int i =0;i<threadInfos.length;i++){
            System.out.println(threadInfos[i].getThreadId()+threadInfos[i].getThreadName());
            System.out.println(threadInfos[i]);
        }
    }
}
